/**
 * 规则主表 api 封装
 *
 * @Author:    chenyuqiang
 * @Date:      2025-08-21 22:46:37
 * @Copyright  1
 */
import { postRequest, getRequest } from '/@/lib/axios';

export const cepApi = {

  /**
   * 分页查询  @author  chenyuqiang
   */
  queryPage : (param) => {
    return postRequest('/cep/queryPage', param);
  },

  /**
   * 增加  @author  chenyuqiang
   */
  add: (param) => {
      return postRequest('/cep/add', param);
  },

  /**
   * 修改  @author  chenyuqiang
   */
  update: (param) => {
      return postRequest('/cep/update', param);
  },


  /**
   * 删除  @author  chenyuqiang
   */
  delete: (id) => {
      return getRequest(`/cep/delete/${id}`);
  },

  /**
   * 批量删除  @author  chenyuqiang
   */
  batchDelete: (idList) => {
      return postRequest('/cep/batchDelete', idList);
  },

  /**
   * 验证EPL语法
   * @param epl EPL规则语句
   * @returns {Promise<any>} 验证结果
   */
  validateEplSyntax(epl) {
    return postRequest('/business/cep/validate-syntax', { epl });
  },

    /**
     * 查询详情  @author  chenyuqiang
     */
    detail: (id) => {
        return getRequest(`/cep/detail/${id}`);
    },

};
